[PATCH 07/24] auth: test-auth - Run Lua unit tests even when building Lua as plugin
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 23 Feb 2026 17:33:16 +0000 (19:33 +0200)
committerNoah Meyerhans <noahm@debian.org>
Tue, 31 Mar 2026 19:07:17 +0000 (15:07 -0400)
Gbp-Pq: Name CVE-2026-24031-27860-4.patch

src/auth/Makefile.am
src/auth/test-lua.c
src/auth/test-main.c

index 4c6c4575f95a3583a499e60d6afc19056707420d..1d4b5d0b1e65882d3700c0485d1b7cfe64d1d300 100644 (file)
@@ -131,6 +131,8 @@ auth_common_sources = \
        $(ldap_sources) \
        $(lua_sources)
 
+test_auth_ldadd_plugins =
+
 headers = \
        auth.h \
        auth-cache.h \
@@ -185,6 +187,7 @@ libauthdb_lua_la_LDFLAGS = -module -avoid-version -shared
 libauthdb_lua_la_LIBADD = $(LIBDOVECOT_LUA)
 libauthdb_lua_la_CPPFLAGS = $(AM_CPPFLAGS) -DPLUGIN_BUILD
 libauthdb_lua_la_SOURCES = $(lua_sources)
+test_auth_ldadd_plugins += libauthdb_lua.la
 endif
 
 libauthdb_imap_la_LDFLAGS = -module -avoid-version -shared
@@ -226,8 +229,8 @@ test_auth_SOURCES = \
        test-mock.c \
        test-main.c
 
-test_auth_LDADD = $(LIBDOVECOT) $(auth_libs) $(AUTH_LIBS) $(LUA_LIBS)
-test_auth_DEPENDENCIES = $(pkglibexec_PROGRAMS) $(LIBDOVECOT_DEPS)
+test_auth_LDADD = $(test_auth_ldadd_plugins) $(LIBDOVECOT) $(LIBDOVECOT_LUA) $(auth_libs) $(AUTH_LIBS) $(LUA_LIBS)
+test_auth_DEPENDENCIES = $(test_auth_ldadd_plugins) $(pkglibexec_PROGRAMS) $(LIBDOVECOT_DEPS)
 
 test_mech_SOURCES = \
        $(auth_common_sources) \
index f64f47eea5844ee00c6f1f1e4d87a3c237461df2..1b53d727dd0b5606985a1ad38f8e24cf137f1fba 100644 (file)
@@ -2,7 +2,7 @@
 
 #include "test-auth.h"
 
-#ifdef BUILTIN_LUA
+#ifdef HAVE_LUA
 #include "istream.h"
 #include "auth-settings.h"
 #include "auth-request.h"
index d82f44f7efc352d1e7d98dd5cb041418b83ec495..cb05fda0571bffbcc2a31c03e49905363ef2cd5c 100644 (file)
@@ -22,7 +22,7 @@ int main(int argc, char *argv[])
                TEST_NAMED(test_auth_request_var_expand)
                TEST_NAMED(test_auth_request_fields)
                TEST_NAMED(test_username_filter)
-#if defined(BUILTIN_LUA)
+#if defined(HAVE_LUA)
                TEST_NAMED(test_db_lua)
 #endif
                { NULL, NULL }